calculate the mean and standard deviation